clang doesn't find filename from linemarker when compiling preprocessed source

Clang appears to always use name as specified on the command line, whereas gcc uses the name as specified in the first linemarker when compiling a preprocessed source. If I use a temporary preprocess file during my build process, the name of the temp file is embedded into the object file. Is this a by-design behavior? Thanks!

Repro:

$ touch test.c

$ gcc -E -o test.i test.c

$ gcc -c -o test.o test.i

$ readelf -a test.o | grep test

1: 0000000000000000 0 FILE LOCAL DEFAULT ABS test.c

$ clang test.c -E -o test.i

$ clang -c -o test.o test.i

$ readelf -a test.o | grep test

1: 0000000000000000 0 FILE LOCAL DEFAULT ABS test.i

$ clang -c -o test.o test.c

$ readelf -a test.o | grep test

1: 0000000000000000 0 FILE LOCAL DEFAULT ABS test.c